home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / colorvignette.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  4KB  |  130 lines

  1. /* ColorVignette.rexx V2.0 -- Fade Pic edges to negative. */
  2. /* By Bob Caron © 1995 NewTek Inc.                        */
  3. /* Originaly by Arnie Cachelin                            */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10.  
  11. screen=0
  12. if inclipname="" & outclipname="" then screen=1
  13. if screen=1 then do
  14.    startfield=1
  15.    endfield=1
  16.    outclipname="Test"
  17.    end
  18.  
  19. IFFBaseName=OutClipName
  20.  
  21. if ~show('l','rexxsupport.library') then do
  22.   if ~addlib('rexxsupport.library',0,-30,34) then do
  23.     exit
  24.   end
  25. end
  26.  
  27. /* Reset Paint */
  28. 'Pmcl'
  29. 'Pot0' 0
  30. 'Pot1' 0
  31. 'Poth' $8000
  32. 'Potv' $8000
  33. 'Spoh' $8000
  34. 'Spov'
  35. /* End Of Reset*/
  36.  
  37. PageWide=752
  38. PageHigh=480
  39. dots=0
  40. XWin = 100
  41. YWin = 40
  42. Clear = d2c(12)
  43. nv = ''
  44. cr = '0a'x
  45. call getfontsize
  46.  
  47. wid = width*48
  48. hei = theight+height*10
  49.  
  50. if screen=0 then do
  51.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/ColorVignette Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  52.        exit
  53.    end
  54. end
  55.  
  56. do Frame = StartField to (StartField+(EndField-StartField)/2)
  57.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  58.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  59.   call filter()                    /* Do The filter Thing...                 */
  60.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  61.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  62.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  63.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  64.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  65.   end
  66. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  67. exit
  68.  
  69. filter:  /* Do a filter */
  70.  
  71. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  72. 'Pmcl'          /* Set to normal paint mode */
  73. 'Hvof'          /* Set to radial gradient off */
  74. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  75. 'Hvar'          /* Toggle radial gradient blend */
  76. 'Potv' $8000    /* Set hotspot center */
  77. 'Poth' $8000    /* Set hotspot  center */
  78. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  79. 'Minc'          /* Set Center transparency to 0% */
  80. 'Maxe'          /* Set Edge transparency to 100% */
  81. 'Whsc'          /* Fill Whole Screen */
  82. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  83.  
  84. return
  85.  
  86.  
  87. OpenWindow:
  88. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  89.   pdots="...."
  90.   dots=dots+1
  91.   if dots>4 then dots=1
  92.   call writech('Window',Clear||nv||cr)
  93.   call writech('Window','Current Source Clip ['InClipName']'cr)
  94.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  95.   call writech('Window',''cr)
  96.   call writech('Window','Current Frame: 'Frame/2''cr)
  97.   call writech('Window','    End Frame:'EndFrame/2''cr)
  98.   call writech('Window',''cr)
  99.   call writech('Window','Processing'right(pdots,dots)||cr)
  100.  
  101. return
  102.  
  103.  
  104. getfontsize:
  105.  
  106. if open('font','env:sys/font.prefs','R') then do
  107.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  108.    call close('font')
  109.    font = substr(font,index(font,'FONT')+4)
  110.    font = substr(font,index(font,'FONT')+4)
  111.    height = c2d(substr(font,29,2))
  112.    tfont = substr(font,index(font,'FONT')+4)
  113.    theight = c2d(substr(tfont,29,2))
  114.    font = substr(font,33)
  115.    font = left(font,index(font,d2c(0))-1-5)
  116.    if open('font','FONTS:'font'/'height,'R') then do
  117.       width = c2d(right(readch('font',116),2))
  118.       call close('font')
  119.   end
  120.   else if height=9 then width = 10
  121.                    else width = 8
  122. end
  123.   else do
  124.   theight = 8
  125.   height = 8
  126.   width = 8
  127. end
  128.  
  129. return
  130.